package com.r2coding.infrastructure.persistent.dao;

import com.r2coding.infrastructure.persistent.po.StrategyRule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 抽奖规则 Dao
 *
 * @author caolx
 * @date 2025/7/22 23:12
 */
@Mapper
public interface IStrategyRuleDao {

    /**
     * 根据策略ID下询置的策略规则
     *
     * @param strategyId 策略ID
     * @return 策略ID下询置的策略规则
     */
    List<StrategyRule> queryStrategyRuleList(Long strategyId);

    /**
     * 查询抽奖策略规则模型配置
     *
     * @param strategyId 抽奖策略ID
     * @param ruleModel  指定规则模型
     * @return 抽奖策略规则模型配置
     */
    StrategyRule queryStrategyRule(@Param("strategyId") Long strategyId,
                                   @Param("ruleModel") String ruleModel);

    /**
     * 查询抽奖策略规则模型配置
     *
     * @param strategyId 策略ID
     * @param awardId    奖品ID
     * @param ruleModel  规则模型
     * @return 规则模型 配置值
     */
    String queryStrategyRuleValue(@Param("strategyId") Long strategyId,
                                  @Param("awardId") Integer awardId,
                                  @Param("ruleModel") String ruleModel);
}
